package yuan.deng.mapper.store;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import yuan.deng.domain.store.Company;

import java.util.List;
/*
* private String id;
    private String name;
    private Date expiration_date;
    private String address;
    private String license_id;
    private String representative;
    private String phone;
    private String company_size;
    private String industry;
    private String remarks;
    private Integer state;
    private String city;*/
public interface CompanyMapper {

    @Insert("insert into st_company values (#{id}, #{name}, #{expiration_date},#{address}, #{license_id}, #{representative},\n" +
            "        #{phone}, #{company_size}, #{industry},#{remarks}, #{state}, #{city})")
    int save(Company company);


    @Delete("delete from st_company where id=#{id} ")
    int delete(String id);


    @Update("update st_company set  name=#{name}, expiration_date=#{expiration_date},address=#{address}, license_id=#{license_id}, representative=#{representative}," +
            "phone=#{phone}, company_size=#{company_size}, industry=#{industry},remarks=#{remarks}, state=#{state}, city=#{city} where id= #{id}")
    int update(Company company);


    @Select("select * from st_company  where id=#{id}")
    Company findById(String id);


    @Select("select * from st_company")
    List<Company> findAll();


}
